//
//  ShareEngine.h
//  YouHui
//
//  Created by  on 11-12-22.
//  Copyright (c) 2011年 netease. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ShareKit.h"
#import "OAuthEngine.h"
#import "ShareAccount.h"


@class ShareEngine,ShareClient,OAuthEngine,OAConsumer,OAToken,ShareAccount;

@protocol ShareEngineDelegate <NSObject>
-(void)shareEngine:(ShareEngine*)engine bindFinished:(NSError*)err;
-(void)shareEngine:(ShareEngine*)engine uploadFinished:(NSError*)err;
-(void)shareEngine:(ShareEngine*)engine accountInfoUpdated:(NSError*)err;
-(void)shareEngine:(ShareEngine *)engine willShowOAuthController:(UIViewController*)controller;
@end

@interface ShareEngine : NSObject<OAuthEngineDelegate> {
    OAuthEngine				*_OAuthEngine;
    ShareClient             *_client;
    UIViewController *_baseViewController;
    id<ShareEngineDelegate> _delegate;
    OAConsumer *_OAConsumer;
    OAToken    *_accessToken;
    ShareAccount *_account;
    NSString *_shareType;
}
@property (nonatomic ,retain) UIViewController        *baseViewController;
@property (nonatomic,assign) id<ShareEngineDelegate> delegate;
@property (nonatomic,readonly) BOOL hasBind;
@property (nonatomic,readonly) ShareAccount *account;
@property (nonatomic,readonly) NSString *shareType;

- (id)initWithType:(NSString*)shareType;
- (void)bindAccount;
- (void)upload:(NSString *)text image:(UIImage *)image;
@end
